package com.lc.activiti.utils.redis;

import cn.hutool.json.JSONObject;
import com.lc.activiti.config.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * redis缓存
 * @author: 骆超
 * @date: 2021/5/20 17:03
 */
@RestController
@RequestMapping("redis")
@Api(tags = "redis缓存")
public class RedisController {

    /**
     * 前端获取redis内容的接口
     * @author 骆超
     * @date 2021/5/20
     * @param jsonObject 参数说明
     * @return com.lc.activiti.config.Result
     */
    @PostMapping("getValue")
    @ApiOperation("前端获取redis内容的接口")
    public Result redisGet(@RequestBody JSONObject jsonObject){
        Object o =  RedisUtil.get(jsonObject.getStr("key"));
        return Result.success(o);
    }
}
